package com.chushouya;

import com.chushouya.common.support.DevOption;
import com.general.framework.core.enums.ContextUserType;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import tk.mybatis.spring.annotation.MapperScan;


/**
 * 后管服务启动主程序
 */
@Slf4j
@EnableAsync
@EnableScheduling
@MapperScan("com.chushouya.*.dao.mapper")
@EnableDiscoveryClient
@SpringBootApplication(scanBasePackages = {"com.general.framework.*", "com.chushouya.*"})
public class ChushouyaWebApplication implements CommandLineRunner {

    @Value("${com.chushouya.devModel:false}")
    private Boolean devModel;

    public static void main(String[] args) {
        SpringApplication.run(ChushouyaWebApplication.class, args);
    }

    @Override
    public void run(final String... args) {
        log.info("===================================");
        log.info("== 服务启动成功 SERVER RUN SUCCESS ==");
        log.info("===================================");
        DevOption.setDevModel(devModel);
        DevOption.setDevModel(ContextUserType.ADMIN_PLATFORM, 100000L,100110L, 100050L, 200018L, 100000L);
    }
}
